home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / text / edit / vim60rt.lha / Vim / vim60 / doc / vim.man < prev    next >
Encoding:
Text File  |  2001-09-03  |  17.4 KB  |  529 lines

  1.  
  2.  
  3.  
  4. VIM(1)                                                     VIM(1)
  5.  
  6.  
  7. NAME
  8.        vim - Vi IMproved, a programmers text editor
  9.  
  10. SYNOPSIS
  11.        vim [options] [file ..]
  12.        vim [options] -
  13.        vim [options] -t tag
  14.        vim [options] -q [errorfile]
  15.  
  16.        ex
  17.        view
  18.        gvim gview
  19.        rvim rview rgvim rgview
  20.  
  21. DESCRIPTION
  22.        Vim is a text editor that is upwards compatible to Vi.  It
  23.        can be used to edit any ASCII text.  It is especially use-
  24.        ful for editing programs.
  25.  
  26.        There  are  a  lot  of  enhancements above Vi: multi level
  27.        undo, multi windows and buffers, syntax highlighting, com-
  28.        mand  line  editing,  filename  completion,  on-line help,
  29.        visual selection, etc..  See  ":help  vi_diff.txt"  for  a
  30.        summary of the differences between Vim and Vi.
  31.  
  32.        While  running  Vim a lot of help can be obtained from the
  33.        on-line help system, with the ":help"  command.   See  the
  34.        ON-LINE HELP section below.
  35.  
  36.        Most  often  Vim is started to edit a single file with the
  37.        command
  38.  
  39.             vim file
  40.  
  41.        More generally Vim is started with:
  42.  
  43.             vim [options] [filelist]
  44.  
  45.        If the filelist is missing, the editor will start with  an
  46.        empty  buffer.  Otherwise exactly one out of the following
  47.        four may be used to choose one or more files to be edited.
  48.  
  49.        file ..     A  list  of  filenames.  The first one will be
  50.                    the current file and  read  into  the  buffer.
  51.                    The  cursor  will  be  positioned on the first
  52.                    line of the buffer.  You can get to the  other
  53.                    files  with  the  ":next"  command.  To edit a
  54.                    file that starts  with  a  dash,  precede  the
  55.                    filelist with "--".
  56.  
  57.        -           The file to edit is read from stdin.  Commands
  58.                    are read from stderr, which should be a tty.
  59.  
  60.        -t {tag}    The  file  to  edit  and  the  initial  cursor
  61.  
  62.  
  63.  
  64.                           2001 March 30                         1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. VIM(1)                                                     VIM(1)
  71.  
  72.  
  73.                    position  depends  on  a "tag", a sort of goto
  74.                    label.  {tag} is looked up in the  tags  file,
  75.                    the  associated  file becomes the current file
  76.                    and  the  associated  command   is   executed.
  77.                    Mostly  this  is used for C programs, in which
  78.                    case {tag} could  be  a  function  name.   The
  79.                    effect  is that the file containing that func-
  80.                    tion becomes the current file and  the  cursor
  81.                    is  positioned  on  the start of the function.
  82.                    See ":help tag-commands".
  83.  
  84.        -q [errorfile]
  85.                    Start in quickFix mode.  The file  [errorfile]
  86.                    is  read and the first error is displayed.  If
  87.                    [errorfile]  is  omitted,  the   filename   is
  88.                    obtained from the 'errorfile' option (defaults
  89.                    to "AztecC.Err" for the Amiga, "errors.vim" on
  90.                    other  systems).  Further errors can be jumped
  91.                    to with the ":cn" command.  See ":help  quick-
  92.                    fix".
  93.  
  94.        Vim behaves differently, depending on the name of the com-
  95.        mand (the executable may still be the same file).
  96.  
  97.        vim       The "normal" way, everything is default.
  98.  
  99.        ex        Start in Ex mode.  Go to Normal  mode  with  the
  100.                  ":vi"  command.   Can also be done with the "-e"
  101.                  argument.
  102.  
  103.        view      Start in read-only mode.  You will be  protected
  104.                  from  writing  the files.  Can also be done with
  105.                  the "-R" argument.
  106.  
  107.        gvim gview
  108.                  The GUI version.  Starts a new window.  Can also
  109.                  be done with the "-g" argument.
  110.  
  111.        rvim rview rgvim rgview
  112.                  Like  the above, but with restrictions.  It will
  113.                  not be possible to start shell commands, or sus-
  114.                  pend  Vim.  Can also be done with the "-Z" argu-
  115.                  ment.
  116.  
  117. OPTIONS
  118.        The options may be given in any  order,  before  or  after
  119.        filenames.   Options  without  an argument can be combined
  120.        after a single dash.
  121.  
  122.        +[num]      For the first file the cursor  will  be  posi-
  123.                    tioned  on  line  "num".  If "num" is missing,
  124.                    the cursor will  be  positioned  on  the  last
  125.                    line.
  126.  
  127.  
  128.  
  129.  
  130.                           2001 March 30                         2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. VIM(1)                                                     VIM(1)
  137.  
  138.  
  139.        +/{pat}     For  the  first  file the cursor will be posi-
  140.                    tioned on the first occurrence of {pat}.   See
  141.                    ":help   search-pattern"   for  the  available
  142.                    search patterns.
  143.  
  144.        +{command}
  145.  
  146.        -c {command}
  147.                    {command} will be  executed  after  the  first
  148.                    file  has been read.  {command} is interpreted
  149.                    as an Ex command.  If the  {command}  contains
  150.                    spaces  it  must  be enclosed in double quotes
  151.                    (this depends on  the  shell  that  is  used).
  152.                    Example: Vim "+set si" main.c
  153.                    Note:  You  can  use up to 10 "+" or "-c" com-
  154.                    mands.
  155.  
  156.        --cmd {command}
  157.                    Like using "-c", but the command  is  executed
  158.                    just  before  processing  any vimrc file.  You
  159.                    can use up to 10 of these  commands,  indepen-
  160.                    dently from "-c" commands.
  161.  
  162.        -b          Binary  mode.   A few options will be set that
  163.                    makes it possible to edit  a  binary  or  exe-
  164.                    cutable file.
  165.  
  166.        -C          Compatible.    Set  the  'compatible'  option.
  167.                    This will make Vim behave mostly like Vi, even
  168.                    though a .vimrc file exists.
  169.  
  170.        -d          Start  in  diff  mode.  There should be two or
  171.                    three file name arguments.  Vim will open  all
  172.                    the  files  and show differences between them.
  173.                    Works like vimdiff(1).
  174.  
  175.        -d {device} Open {device} for use as a terminal.  Only  on
  176.                    the Amiga.  Example: "-d con:20/30/600/150".
  177.  
  178.        -e          Start Vim in Ex mode, just like the executable
  179.                    was called "ex".
  180.  
  181.        -f          Foreground.  For the GUI version, Vim will not
  182.                    fork  and detach from the shell it was started
  183.                    in.  On the Amiga, Vim  is  not  restarted  to
  184.                    open a new window.  This option should be used
  185.                    when Vim is executed by a  program  that  will
  186.                    wait  for  the  edit  session  to finish (e.g.
  187.                    mail).  On the Amiga the ":sh" and  ":!"  com-
  188.                    mands will not work.
  189.  
  190.        -F          If  Vim  has  been compiled with FKMAP support
  191.                    for editing right-to-left oriented  files  and
  192.                    Farsi keyboard mapping, this option starts Vim
  193.  
  194.  
  195.  
  196.                           2001 March 30                         3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. VIM(1)                                                     VIM(1)
  203.  
  204.  
  205.                    in Farsi mode, i.e.  'fkmap'  and  'rightleft'
  206.                    are  set.  Otherwise an error message is given
  207.                    and Vim aborts.
  208.  
  209.        -g          If Vim has been  compiled  with  GUI  support,
  210.                    this  option  enables the GUI.  If no GUI sup-
  211.                    port was compiled  in,  an  error  message  is
  212.                    given and Vim aborts.
  213.  
  214.        -h          Give  a  bit  of  help  about the command line
  215.                    arguments and options.  After this Vim  exits.
  216.  
  217.        -H          If  Vim  has been compiled with RIGHTLEFT sup-
  218.                    port for editing right-to-left oriented  files
  219.                    and   Hebrew  keyboard  mapping,  this  option
  220.                    starts Vim in Hebrew mode,  i.e.  'hkmap'  and
  221.                    'rightleft'  are set.  Otherwise an error mes-
  222.                    sage is given and Vim aborts.
  223.  
  224.        -i {viminfo}
  225.                    When using the viminfo file is  enabled,  this
  226.                    option  sets  the  filename to use, instead of
  227.                    the default "~/.viminfo".  This  can  also  be
  228.                    used  to skip the use of the .viminfo file, by
  229.                    giving the name "NONE".
  230.  
  231.        -L          Same as -r.
  232.  
  233.        -l          Lisp mode.  Sets the  'lisp'  and  'showmatch'
  234.                    options on.
  235.  
  236.        -m          Modifying   files  is  disabled.   Resets  the
  237.                    'write' option, so that writing files  is  not
  238.                    possible.
  239.  
  240.        -N          No-compatible  mode.   Reset  the 'compatible'
  241.                    option.  This will make Vim behave a bit  bet-
  242.                    ter,  but  less  Vi  compatible, even though a
  243.                    .vimrc file does not exist.
  244.  
  245.        -n          No swap file will be used.  Recovery  after  a
  246.                    crash  will  be impossible.  Handy if you want
  247.                    to edit a file on a  very  slow  medium  (e.g.
  248.                    floppy).   Can  also be done with ":set uc=0".
  249.                    Can be undone with ":set uc=200".
  250.  
  251.        -o[N]       Open N windows.  When N is omitted,  open  one
  252.                    window for each file.
  253.  
  254.        -R          Read-only mode.  The 'readonly' option will be
  255.                    set.  You can still edit the buffer, but  will
  256.                    be  prevented  from  accidently  overwriting a
  257.                    file.  If you do want to overwrite a file, add
  258.                    an  exclamation  mark to the Ex command, as in
  259.  
  260.  
  261.  
  262.                           2001 March 30                         4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. VIM(1)                                                     VIM(1)
  269.  
  270.  
  271.                    ":w!".  The -R  option  also  implies  the  -n
  272.                    option (see below).  The 'readonly' option can
  273.                    be reset with ":set noro".  See ":help  'read-
  274.                    only'".
  275.  
  276.        -r          List  swap files, with information about using
  277.                    them for recovery.
  278.  
  279.        -r {file}   Recovery mode.   The  swap  file  is  used  to
  280.                    recover  a  crashed editing session.  The swap
  281.                    file is a file with the same filename  as  the
  282.                    text  file  with  ".swp" appended.  See ":help
  283.                    recovery".
  284.  
  285.        -s          Silent mode.  Only when  started  as  "Ex"  or
  286.                    when the "-e" option was given before the "-s"
  287.                    option.
  288.  
  289.        -s {scriptin}
  290.                    The script file {scriptin} is read.  The char-
  291.                    acters  in  the file are interpreted as if you
  292.                    had typed them.  The same can be done with the
  293.                    command  ":source! {scriptin}".  If the end of
  294.                    the file is reached before the  editor  exits,
  295.                    further characters are read from the keyboard.
  296.  
  297.        -T {terminal}
  298.                    Tells Vim the name of  the  terminal  you  are
  299.                    using.   Only  required when the automatic way
  300.                    doesn't work.  Should be a terminal  known  to
  301.                    Vim  (builtin)  or  defined  in the termcap or
  302.                    terminfo file.
  303.  
  304.        -u {vimrc}  Use the commands in the file {vimrc} for  ini-
  305.                    tializations.   All  the other initializations
  306.                    are skipped.  Use this to edit a special  kind
  307.                    of  files.   It  can  also be used to skip all
  308.                    initializations by  giving  the  name  "NONE".
  309.                    See ":help initialization" within vim for more
  310.                    details.
  311.  
  312.        -U {gvimrc} Use the commands in the file {gvimrc} for  GUI
  313.                    initializations.   All  the other GUI initial-
  314.                    izations are skipped.  It can also be used  to
  315.                    skip  all  GUI  initializations  by giving the
  316.                    name "NONE".  See ":help gui-init" within  vim
  317.                    for more details.
  318.  
  319.        -V          Verbose.   Give messages about which files are
  320.                    sourced and for reading and writing a  viminfo
  321.                    file.
  322.  
  323.        -v          Start Vim in Vi mode, just like the executable
  324.                    was called "vi".  This only  has  effect  when
  325.  
  326.  
  327.  
  328.                           2001 March 30                         5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. VIM(1)                                                     VIM(1)
  335.  
  336.  
  337.                    the executable is called "ex".
  338.  
  339.        -w {scriptout}
  340.                    All  the characters that you type are recorded
  341.                    in the file {scriptout}, until you  exit  Vim.
  342.                    This  is useful if you want to create a script
  343.                    file to be used with "vim -s"  or  ":source!".
  344.                    If the {scriptout} file exists, characters are
  345.                    appended.
  346.  
  347.        -W {scriptout}
  348.                    Like -w, but an existing file is  overwritten.
  349.  
  350.        -x          Use  encryption  when  writing  files.    Will
  351.                    prompt for a crypt key.
  352.  
  353.        -Z          Restricted mode.  Works  like  the  executable
  354.                    starts with "r".
  355.  
  356.        --          Denotes  the  end  of  the options.  Arguments
  357.                    after this will be handled  as  a  file  name.
  358.                    This  can  be  used  to  edit  a filename that
  359.                    starts with a '-'.
  360.  
  361.        --help      Give a help message and exit, just like  "-h".
  362.  
  363.        --remote    Connect  to  a Vim server and make it edit the
  364.                    files given in the rest of the arguments.
  365.  
  366.        --serverlist
  367.                    List the names of all Vim servers that can  be
  368.                    found.
  369.  
  370.        --servername {name}
  371.                    Use  {name}  as the server name.  Used for the
  372.                    current Vim, unless used with  a  --serversend
  373.                    or  --remote, then it's the name of the server
  374.                    to connect to.
  375.  
  376.        --serversend {keys}
  377.                    Connect to a Vim server and send {keys} to it.
  378.  
  379.        --version   Print version information and exit.
  380.  
  381. ON-LINE HELP
  382.        Type  ":help" in Vim to get started.  Type ":help subject"
  383.        to get help on a specific subject.   For  example:  ":help
  384.        ZZ" to get help for the "ZZ" command.  Use <Tab> and CTRL-
  385.        D to complete subjects (":help cmdline-completion").  Tags
  386.        are  present  to  jump  from one place to another (sort of
  387.        hypertext links, see ":help").   All  documentation  files
  388.        can be viewed in this way, for example ":help syntax.txt".
  389.  
  390.  
  391.  
  392.  
  393.  
  394.                           2001 March 30                         6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. VIM(1)                                                     VIM(1)
  401.  
  402.  
  403. FILES
  404.        /usr/local/lib/vim/doc/*.txt
  405.                       The Vim documentation  files.   Use  ":help
  406.                       doc-file-list" to get the complete list.
  407.  
  408.        /usr/local/lib/vim/doc/tags
  409.                       The  tags file used for finding information
  410.                       in the documentation files.
  411.  
  412.        /usr/local/lib/vim/syntax/syntax.vim
  413.                       System wide syntax initializations.
  414.  
  415.        /usr/local/lib/vim/syntax/*.vim
  416.                       Syntax files for various languages.
  417.  
  418.        /usr/local/lib/vim/vimrc
  419.                       System wide Vim initializations.
  420.  
  421.        /usr/local/lib/vim/gvimrc
  422.                       System wide gvim initializations.
  423.  
  424.        /usr/local/lib/vim/optwin.vim
  425.                       Script used for the ":options"  command,  a
  426.                       nice way to view and set options.
  427.  
  428.        /usr/local/lib/vim/menu.vim
  429.                       System  wide menu initializations for gvim.
  430.  
  431.        /usr/local/lib/vim/bugreport.vim
  432.                       Script  to  generate  a  bug  report.   See
  433.                       ":help bugs".
  434.  
  435.        /usr/local/lib/vim/filetype.vim
  436.                       Script  to detect the type of a file by its
  437.                       name.  See ":help 'filetype'".
  438.  
  439.        /usr/local/lib/vim/scripts.vim
  440.                       Script to detect the type of a file by  its
  441.                       contents.  See ":help 'filetype'".
  442.  
  443.        /usr/local/lib/vim/*.ps
  444.                       Files used for PostScript printing.
  445.  
  446.        For recent info read the VIM home page:
  447.        <URL:http://www.vim.org/>
  448.  
  449. SEE ALSO
  450.        vimtutor(1)
  451.  
  452. AUTHOR
  453.        Most of Vim was made by Bram Moolenaar, with a lot of help
  454.        from others.  See ":help credits" in Vim.
  455.        Vim is based on Stevie, worked on by: Tim  Thompson,  Tony
  456.        Andrews  and  G.R.  (Fred) Walter.  Although hardly any of
  457.  
  458.  
  459.  
  460.                           2001 March 30                         7
  461.  
  462.  
  463.  
  464.  
  465.  
  466. VIM(1)                                                     VIM(1)
  467.  
  468.  
  469.        the original code remains.
  470.  
  471. BUGS
  472.        Probably.  See ":help todo" for a list of known  problems.
  473.  
  474.        Note  that a number of things that may be regarded as bugs
  475.        by some, are in fact caused by a too-faithful reproduction
  476.        of Vi's behaviour.  And if you think other things are bugs
  477.        "because Vi does it differently", you should take a closer
  478.        look  at  the  vi_diff.txt file (or type :help vi_diff.txt
  479.        when in Vim).  Also have a look at  the  'compatible'  and
  480.        'cpoptions' options.
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.                           2001 March 30                         8
  527.  
  528.  
  529.